#pragma once

#include "input.h"

#include <string>
#include <vector>

class ConsoleImpl;

class Console{
	public:
		explicit Console(const std::string& title, const int width = DEFAULT_WIDTH, const int height = DEFAULT_HEIGHT);
		~Console();
		
		void SetTitle(const std::string& title);
		const std::string& GetTitle() const;

		void SetSize(const int width, const int height);
		int GetWidth() const;
		int GetHeight() const;

		void ReadInputs(std::vector<Input>& inputs);

		int WriteString(
			const int row,
			const int col,
			const std::string& value,
			const int attr = DEFAULT_ATTRIBUTES,
			const int highlight_attr = NO_HIGHLIGHT);

		void Flush();
		float TimeElapsedSinceLastFlush() const;

		static const int DEFAULT_WIDTH = 80;
		static const int DEFAULT_HEIGHT = 50;

		static const int DEFAULT_ATTRIBUTES = -1;

		static const int NO_HIGHLIGHT = -1;
		static const int COLORS_HIGHLIGHT = -2;
		static const int REVERSE_COLORS_HIGHLIGHT = -3;

		static const int NO_ENTRY = -1;

private:
		Console(const Console&); // disabled
		Console& operator=(const Console&); // disabled

		ConsoleImpl* impl_;
};